<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <h1>1231231213</h1>
  <script>
    console.time();
    for(let i = 0;i<1000000;i++) {
      const h1 = document.createElement('h1');
      h1.innerHTML = i
      document.body.appendChild(h1)
    }
    console.timeEnd()
   
    console.time();
    const arr = []
    for(let i = 0;i<1000000;i++) {
      arr.push({
        tag: 'h1',
        children: [i]
      })
    }
    console.timeEnd()
   
  </script>
</body>
</html>